<template>
	<view class="flex-col homepage">
		<view class="Recharge">
			<view class="q1"> <text class="k2">账户余额:{{balance}}</text> <text class="k1" @click="cz">充值</text> </view>
		</view>
		<u-line class="w1"></u-line>
		<view class="u-line-1 text" id="qw">我的缴费</view>
		<view class="flex-row wrapper" v-for="item in productList" id="qq">
			<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100" :height="100">
			</u-icon>
			<view class="flex-col flex-row wraper-col" @click="submit(item)">
				<view class="u-line-1 text-two">{{item.type}}</view>
				<view class="u-line-1 text-three">{{item.userNumber}}</view>
			</view>
			<view class="u-line-1 text-four">{{item.phone}}</view>
		</view>
		<u-line></u-line>
		<view class="u-line-1 text-eight">新增缴费</view>
		<view class="flex-row wrapper-three">
			<view class="flex-row wraper-col-three" @click="jiaofei">
				<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100"
					:height="100"></u-icon>
				<view class="u-line-1 text-nine">电费</view>
			</view>
			<view class="flex-row wraper-col-four" @click="jiaofei1">
				<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100"
					:height="100"></u-icon>
				<view class="u-line-1 text-ten">水费</view>
			</view>
		</view>
		<view class="flex-row wrapper-four">
			<view class="flex-row wraper-col-five" @click="jiaofei2">
				<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100"
					:height="100"></u-icon>
				<view class="box"></view>
				<view class="u-line-1 text-eleven" @click="jiaofei2">物业费</view>
			</view>
			<view class="flex-row wraper-col-six" @click="jiaofei3">
				<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100"
					:height="100"></u-icon>
				<view class="u-line-1 text-twelve" @click="jiaofei3">燃气费</view>
			</view>
		</view>
		<view class="flex-row wrapper-five">
			<view class="flex-row wraper-col-seven" @click="jiaofei4">
				<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100"
					:height="100"></u-icon>
				<view class="u-line-1 text-thirteen">宽带费</view>
			</view>
			<view class="flex-row wraper-col-eight" @click="jiaofei5">
				<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100"
					:height="100"></u-icon>
				<view class="u-line-1 text-fourteen">暖气费</view>
			</view>
		</view>
		<view class="flex-row wrapper-six" @click="jiaofei6">
			<u-icon class="icon-u" name="https://cdn.uviewui.com/uview/example/button.png" :width="100" :height="100">
			</u-icon>
			<view class="u-line-1 text-fifteen">车位费</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				productList: [],
				balance: ""
			}
		},
		onLoad() {
			this.getbalance()
			this.getcfMypayment();
		},
		methods: {
			//取出session中的余额
			getbalance() {
				let _this = this
				uni.getStorage({
					key: 'balance',
					success: function(res) {
						_this.data = res.data
					}
				});
				this.balance = _this.data
			},
			// 充值
			cz() {
				uni.navigateTo({
					url: './feedetails/recharge'
				})
			},
			//获取用户所有的缴费
			getcfMypayment() {
				this.$axios({
					url: '/systemuser/payment-type/cfMypayment',
					data: {
						id: 1,
					},
					method: 'GET',
					success: (res) => {
						if (res.data.success == true) {
							console.log("数据", res)
							// debugger
							this.productList = res.data.data.list
							this.balance=res.data.data.balance
							// const aa= res.data.data.list
							// const bb=[]
							// if (aa != null) {
							// 	for (var i = 0; i < aa.length; i++) {
							// 		if (aa[i].type === "非常紧急") {
							// 			bb.push(aa[i])
							// 			this.xinxi=aa[i].content
							// 		}
							// 	}
							// }
							// this.uu=bb
						}
					}
				})
			},
			//点击缴费
			jiaofei() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "电费"
				})
			},
			jiaofei1() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "水费"
				})
			},
			jiaofei2() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "物业费"
				})
			},
			jiaofei3() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "燃气费"
				})
			},
			jiaofei4() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "宽带费"
				})
			},
			jiaofei5() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "暖气费"
				})
			},
			jiaofei6() {
				uni.navigateTo({
					url: './feedetails/newpayment?item=' + "车位费"
				})
			},
			submit(item) {
				uni.navigateTo({
					url: `./feedetails/feedetails?item=${encodeURIComponent(JSON.stringify(item))}`,
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	/** 全局样式-开始,建议放在公共css样式文件中,比如common.css 或app.vue文件 */
	.k2 {
		display: block;
		margin-top: 50rpx;
		margin-left: 10rpx;
		color: #ffffff;
	}

	#qw {
		margin-top: 30rpx;
	}

	#qq {
		box-shadow: 1px 1px 1px 1px #468dd4;
		border-radius: 20rpx;
	}

	.k1 {
		position: absolute;
		left: 10px;
		top: 1px;
		margin-left: 600rpx;
		color: #0000ff;
	}

	.Recharge {
		border-radius: 20rpx;
		// width: 300rpx;
		width: 710rpx;
		height: 150rpx;
		font-size: 30rpx;
		background-color: #00aaff;
		box-shadow: 2px 2px 5px 2px #468dd4;
	}

	u-icon {
		width: 100rpx;
		height: 100rpx;
	}

	html,
	body {
		margin: 0;
		width: 100%;
		height: 100%;
		font-size: 16px
	}

	view,
	text,
	image {
		position: relative;
		box-sizing: border-box;
		flex-shrink: 0;
	}

	.flex-col {
		display: flex;
		align-items: flex-start;
		flex-direction: column;
	}

	.flex-row {
		display: flex;
		align-items: flex-start;
	}

	.flex-col .flex-row {
		width: 100%
	}

	/** 全局样式-结束*/

	.homepage {
		height: 1334rpx;
		padding: 40rpx 23rpx 0rpx 23rpx;
		color: 40rpx;

		.text {
			width: 160rpx;
			margin-bottom: 18rpx;
			font-size: 40rpx;
		}

		.wrapper {
			width: 704rpx;
			justify-content: space-between;
			margin-bottom: 30rpx;
			padding: 32rpx 80rpx 32rpx 0rpx;
			background: #ecf5ff;

			.icon-u {
				width: 100rpx;
			}

			.wraper-col {
				width: 224rpx;
				margin-top: 4rpx;

				.text-two {
					width: 142rpx;
					margin-bottom: 20rpx;
					font-size: 30rpx;
				}

				.text-three {
					width: 100%;
				}
			}

			.text-four {
				width: 240rpx;
				margin-top: 62rpx;
			}
		}

		.wrapper-two {
			width: 704rpx;
			justify-content: space-between;
			margin-bottom: 60rpx;
			padding: 32rpx 72rpx 32rpx 0rpx;
			background: #ecf5ff;

			.icon-u {
				width: 100rpx;
			}

			.wraper-col-two {
				width: 334rpx;
				margin-top: 4rpx;

				.text-five {
					width: 142rpx;
					margin-bottom: 20rpx;
					font-size: 30rpx;
				}

				.text-six {
					width: 100%;
				}
			}

			.text-seven {
				width: 176rpx;
				margin-top: 62rpx;
			}
		}

		.text-eight {
			width: 184rpx;
			margin-bottom: 28rpx;
			font-size: 40rpx;
		}

		.wrapper-three {
			width: 656rpx;
			justify-content: space-between;
			margin-bottom: 34rpx;

			.wraper-col-three {
				width: 302rpx;
				justify-content: space-between;
				padding: 22rpx 50rpx 22rpx 12rpx;
				border-width: 2rpx;
				border-style: solid;
				border-radius: 30rpx;
				background: #fdf6ec;
				outline: 0rpx;

				.icon-u {
					width: 100rpx;
				}

				.text-nine {
					width: 106rpx;
					margin-top: 30rpx;
					font-size: 32rpx;
				}
			}

			.wraper-col-four {
				width: 302rpx;
				justify-content: space-between;
				padding: 22rpx 54rpx 22rpx 12rpx;
				border-width: 2rpx;
				border-style: solid;
				border-radius: 30rpx;
				background: #fdf6ec;

				.icon-u {
					width: 100rpx;
				}

				.text-ten {
					width: 106rpx;
					margin-top: 30rpx;
					font-size: 32rpx;
				}
			}
		}

		.wrapper-four {
			width: 656rpx;
			justify-content: space-between;
			margin-bottom: 48rpx;

			.wraper-col-five {
				width: 302rpx;
				justify-content: space-between;
				padding: 22rpx 50rpx 22rpx 12rpx;
				border-width: 2rpx;
				border-style: solid;
				border-radius: 30rpx;
				background: #fdf6ec;

				.icon-u {
					width: 100rpx;
				}

				.box {
					width: 14rpx;
					height: 8rpx;
					margin-top: 60rpx;
				}

				.text-eleven {
					width: 106rpx;
					margin-top: 30rpx;
					font-size: 32rpx;
				}
			}

			.wraper-col-six {
				width: 302rpx;
				justify-content: space-between;
				padding: 22rpx 50rpx 22rpx 12rpx;
				border-width: 2rpx;
				border-style: solid;
				border-radius: 30rpx;
				background: #fdf6ec;

				.icon-u {
					width: 100rpx;
				}

				.text-twelve {
					width: 106rpx;
					margin-top: 30rpx;
					font-size: 32rpx;
				}
			}
		}

		.wrapper-five {
			width: 656rpx;
			justify-content: space-between;
			margin-bottom: 34rpx;

			.wraper-col-seven {
				width: 302rpx;
				justify-content: space-between;
				padding: 22rpx 50rpx 22rpx 12rpx;
				border-width: 2rpx;
				border-style: solid;
				border-radius: 30rpx;
				background: #fdf6ec;

				.icon-u {
					width: 100rpx;
				}

				.text-thirteen {
					width: 106rpx;
					margin-top: 30rpx;
					font-size: 32rpx;
				}
			}

			.wraper-col-eight {
				width: 302rpx;
				justify-content: space-between;
				padding: 22rpx 50rpx 22rpx 12rpx;
				border-width: 2rpx;
				border-style: solid;
				border-radius: 30rpx;
				background: #fdf6ec;

				.icon-u {
					width: 100rpx;
				}

				.text-fourteen {
					width: 106rpx;
					margin-top: 30rpx;
					font-size: 32rpx;
				}
			}
		}

		.wrapper-six {
			width: 302rpx;
			justify-content: space-between;
			padding: 22rpx 50rpx 22rpx 12rpx;
			border-width: 2rpx;
			border-style: solid;
			border-radius: 30rpx;
			background: #fdf6ec;

			.icon-u {
				width: 100rpx;
			}

			.text-fifteen {
				width: 106rpx;
				margin-top: 30rpx;
				font-size: 32rpx;
			}
		}
	}
</style>
